r = 1 gotfloppy = 1 teacher = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 9) AS STRING directions(1) = "NORTH" directions(2) = "NEAST OR SOUTH" directions(3) = "EAST OR WEST" directions(4) = "WEST OR SOUTH" directions(5) = "NORTH OR EAST" directions(6) = "WEST OR SOUTH" directions(7) = "NORTH OR EAST" directions(8) = "WEST OR EAST" directions(9) = "WEST" PRINT "" PRINT "" PRINT "It's the first week back to school and in that short period of time, you" PRINT "realize how boring school is. Plus you've got into gaming with your friends." PRINT "So you and your friends decide to cut class and sneak into the computer lab." PRINT "Now, they are waiting for you and all you must do is sneak down the hall and" PRINT "meet up with them." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " Computer Lab Adventure " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotfloppy = 1 THEN: PRINT "A copy of a great computer game." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 5 THEN: r = 4: GOTO moved IF r = 7 THEN: r = 6: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 7 THEN: r = 8: GOTO moved IF r = 8 THEN: r = 9: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 6 THEN: r = 7: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 9 THEN: r = 8: GOTO moved IF r = 8 THEN: r = 7: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 4 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 2: GOTO moved END IF IF (cmd$ = "TALK TO MR. WALT") AND r = 7 THEN CLS PRINT "What are you doing young man? Shouldn't you be in class? Return to" PRINT "class right now or you'll be given such a thrashing!" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE TEACHER") AND r = 7 THEN CLS PRINT "Mr. Walt, or what we like to call him, life's living joke. Smells as" PRINT "if he's been drinking all morning. His face looks like all hope is" PRINT "lost within him. He is also holding a cup of coffee." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE FLOPPY") AND gotfloppy = 1 THEN CLS PRINT "It's a 3.5 inch HD floppy diskette. Loaded to the brim with what" PRINT "could only be described as the worlds greatest game." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "THROW COFFEE") AND r = 7 THEN CLS PRINT "You pause for a moment not knowing what to do. So you do what only" PRINT "comes naturally. You grab his hot cup of coffee and throw it in his" PRINT "face. As he screams in pain, he's blinded for life, and maybe you" PRINT "should getting moving?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "SIT DOWN AND USE FLOPPY") AND gotfloppy = 1 AND r = 9 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "RETURN TO CLASS") AND r = 9 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing outside of your Math class. The teacher left" PRINT "to get some coffee and now's your chance." RETURN r2: PRINT "The hall is quite and not a soul in sight." RETURN r3: PRINT "The scent of pink saw dust and bleach fills the air. Must be fish" PRINT "day in the cafeteria?" RETURN r4: PRINT "You hear the echoes of laughter and students talking loud in" PRINT "class. You start to sweat and feel as if you are going to get" PRINT "caught." RETURN r5: PRINT "You are standing in a short hallway. Rows of lockers are lined" PRINT "up on both sides of the walls." RETURN r6: PRINT "Though you just chuck the feelings of getting caught up to nerves." PRINT "You continue up your way." RETURN r7: PRINT "Before you continue upon your journey. You stop dead in mid walk." PRINT "You see a teacher just standing in the hallway...great." RETURN r8: PRINT "Quickly, you run down the hallway until you see the computer lab" PRINT "door in the horizon." RETURN r9: PRINT "You are now finally in the computer lab, your friends are sitting" PRINT "in the back, and as you make your way over towards them." RETURN win: COLOR 2, 0 CLS PRINT "You enjoy the rest of the day playing with them. You wonder" PRINT "what ever happened to Mr. Walt? But at this moment who cares." PRINT "This is the time to enjoy playing some games with your friends." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "You slowly walk back to class and return to your seat. You feel" PRINT "like a fool and before you know it the day is done. While on the" PRINT "bus you don't see your friends anywhere. Maybe they got caught?" PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "You take to long sneaking to the computer lab and before you know it the" PRINT "day is over. -Sigh- Maybe tomorrow you'll be able to play on the school" PRINT "computers?" _DISPLAY END END SUB